package com.ysd.dao.impl;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;

import com.ysd.entity.ProductclassifiCationTable;
import com.ysd.util.DBManager;

public class DdaoImpl {
	public List<ProductclassifiCationTable> ProductclassifiCationTable(int pid){
		List<ProductclassifiCationTable> list = new ArrayList<ProductclassifiCationTable>();
		Connection conn = DBManager.grtConnection();
		Statement st = null;
		ResultSet rs = null;
		try {
			st = conn.createStatement();
			
			rs = st.executeQuery("select * from ProductclassifiCationTable where productclassid="+pid);
			while(rs.next()) {
				int productclassid = rs.getInt("productclassid");
				String productcategory = rs.getString("productcategory");
				ProductclassifiCationTable  Productdetailsinfo = new ProductclassifiCationTable(productclassid,productcategory);
				list.add(Productdetailsinfo);
			}
			return list;
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			return null;
		}finally {
			DBManager.closeAll(conn, st, rs);
		}
	} 
}
